package com.ruoyi.zhhq.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.zhhq.mapper.ZhhqCanteecateMapper;
import com.ruoyi.zhhq.domain.ZhhqCanteecate;
import com.ruoyi.zhhq.service.IZhhqCanteecateService;

/**
 * 餐厅分类Service业务层处理
 * 
 * @author ZLC
 * @date 2022-11-02
 */
@Service
public class ZhhqCanteecateServiceImpl implements IZhhqCanteecateService 
{
    @Autowired
    private ZhhqCanteecateMapper zhhqCanteecateMapper;

    /**
     * 查询餐厅分类
     * 
     * @param rcateId 餐厅分类主键
     * @return 餐厅分类
     */
    @Override
    public ZhhqCanteecate selectZhhqCanteecateByRcateId(String rcateId)
    {
        return zhhqCanteecateMapper.selectZhhqCanteecateByRcateId(rcateId);
    }

    /**
     * 查询餐厅分类列表
     * 
     * @param zhhqCanteecate 餐厅分类
     * @return 餐厅分类
     */
    @Override
    public List<ZhhqCanteecate> selectZhhqCanteecateList(ZhhqCanteecate zhhqCanteecate)
    {
        return zhhqCanteecateMapper.selectZhhqCanteecateList(zhhqCanteecate);
    }
    
    /**
     * 查询餐厅分类列表
     * 
     * @return 餐厅分类集合
     */
    @Override
    public List<ZhhqCanteecate> selectZhhqCanteecateListAll(){
    	 return zhhqCanteecateMapper.selectZhhqCanteecateListAll();
    };

    /**
     * 新增餐厅分类
     * 
     * @param zhhqCanteecate 餐厅分类
     * @return 结果
     */
    @Override
    public int insertZhhqCanteecate(ZhhqCanteecate zhhqCanteecate)
    {
        zhhqCanteecate.setCreateTime(DateUtils.getNowDate());
        return zhhqCanteecateMapper.insertZhhqCanteecate(zhhqCanteecate);
    }

    /**
     * 修改餐厅分类
     * 
     * @param zhhqCanteecate 餐厅分类
     * @return 结果
     */
    @Override
    public int updateZhhqCanteecate(ZhhqCanteecate zhhqCanteecate)
    {
        zhhqCanteecate.setUpdateTime(DateUtils.getNowDate());
        return zhhqCanteecateMapper.updateZhhqCanteecate(zhhqCanteecate);
    }

    /**
     * 批量删除餐厅分类
     * 
     * @param rcateIds 需要删除的餐厅分类主键
     * @return 结果
     */
    @Override
    public int deleteZhhqCanteecateByRcateIds(String[] rcateIds)
    {
        return zhhqCanteecateMapper.deleteZhhqCanteecateByRcateIds(rcateIds);
    }

    /**
     * 删除餐厅分类信息
     * 
     * @param rcateId 餐厅分类主键
     * @return 结果
     */
    @Override
    public int deleteZhhqCanteecateByRcateId(String rcateId)
    {
        return zhhqCanteecateMapper.deleteZhhqCanteecateByRcateId(rcateId);
    }
}
